package database;

import java.io.File;

public class CleanPersistence {
	private final String PATH = "Database/";
	private File file;
	public CleanPersistence() {
		file = new File(PATH);
	}
	
	public void cleanPersistence() {
		cleanPersistence(new File("Database/"));
	}
	
	public void cleanPersistence(File dir) {
		File[] files = dir.listFiles();
		for(File fileToRemove : files) {
			//System.out.println(fileToRemove.getAbsolutePath());
			if(fileToRemove.isDirectory() && !fileToRemove.getName().equals(".svn")) {
				cleanPersistence(fileToRemove);
			}
			
			fileToRemove.delete();
		}
	}
	
	/*public static void main(String[] args) {
		CleanPersistence cp = new CleanPersistence();
		cp.cleanPersistence(new File("Database/"));
		//cp.cleanPersistence();
	}*/
}
